package com.lynx.system.service;

import com.lynx.system.repository.AdminRepository;
import com.lynx.system.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AdminRepository adminRepository;
    @Autowired
    private UserRepository userRepository;
    @Override
    public Object login(String username, String password, String type) {
        Object result = null;
        if("admin".equals(type)){
            result = adminRepository.loginAdmin(username, password);
        }else if ("user".equals(type)){
            result = userRepository.loginUser(username, password);
        }
        return result;
    }
}
